var h = Object.defineProperty, g = Object.defineProperties;
var m = Object.getOwnPropertyDescriptors;
var l = Object.getOwnPropertySymbols;
var y = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
var i = (t, e, n) => e in t ? h(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, o = (t, e) => {
  for (var n in e || (e = {}))
    y.call(e, n) && i(t, n, e[n]);
  if (l)
    for (var n of l(e))
      x.call(e, n) && i(t, n, e[n]);
  return t;
}, s = (t, e) => g(t, m(e));
import { toRefs as S, computed as r } from "vue";
import { c as k } from "../component-87e22bdd.mjs";
import { c as C } from "../props-c0e5b20d.mjs";
/*!
* Vin UI 移动端 Vue3 组件库 v0.2.9 Fri Jun 02 2023 21:01:02 GMT+0800 (中国标准时间)
* (c) 2023 @vingogo.
* Released under the MIT License.
*/
const I = s(o({}, C), {
  leftShow: { type: Boolean, default: !0 },
  // 左侧  是否显示返回icon
  title: { type: String, default: "" },
  // 中间  文字标题
  titIcon: { type: String, default: "" },
  // 中间  标题icon
  desc: { type: String, default: "" },
  // 右侧   按钮文字
  fixed: {
    type: Boolean,
    default: !1
  },
  safeAreaInsetTop: {
    type: Boolean,
    default: !1
  },
  // 生成一个等高的占位元素
  placeholder: {
    type: Boolean,
    default: !0
  },
  zIndex: {
    type: [Number, String],
    default: 10
  }
}), { componentName: v, create: b, useVinContext: B } = k("navbar"), P = b({
  props: I,
  emits: ["on-click-back", "on-click-title", "on-click-icon", "on-click-right"],
  setup(t, { emit: e }) {
    const { getMainClass: n, getMainStyle: d } = B(t), { fixed: f, safeAreaInsetTop: c } = S(t), p = r(() => {
      const a = v;
      return n({
        [`${a}--fixed`]: f.value,
        [`${a}--safe-area-inset-top`]: c.value
      });
    });
    return {
      mainStyle: r(() => {
        const a = uni.getSystemInfoSync().statusBarHeight, u = c.value && a ? {
          height: `calc(var(--vin-navbar-height, 46px) + ${a}px)`,
          paddingTop: `${a}px`
        } : {};
        return d(o({
          zIndex: t.zIndex
        }, u));
      }),
      mainClass: p,
      handleLeft: () => {
        e("on-click-back");
      },
      handleCenter: () => {
        e("on-click-title");
      },
      handleCenterIcon: () => {
        e("on-click-icon");
      },
      handleRight: () => {
        e("on-click-right");
      }
    };
  }
});
export {
  P as default
};
